package ooday01;
/** 继承类测试 */
public class ExtendsText {
    public static void main(String[] args) {
        Student zs = new Student();
        zs.name = "张三";
        zs.age = 23;
        zs.address = "北京";
        zs.className = "jsd2411";
        zs.stuid = "001";
        zs.eat();
        zs.sleep();
        zs.sayHi();
        zs.study();

        Student ww = new Student("王五",24,"陕西","jsd2411","001");
        ww.eat();
        ww.sleep();
        ww.sayHi();
        ww.study();

        Teacher zl = new Teacher("赵六",34,"山西",6000.0);

        Doctor tq = new Doctor("田七",47,"安徽","主任医师");

        //演示超类不能访问派生类
        Person p = new Person();
        p.name = "人";
        p.age = 1;
        p.address = "未知";
        p.eat();
        p.sleep();
        p.sayHi();
        //   p.stuid = "005";  //编译错误，超类不能访问派生类的

    }
}
